<template>
	<view class="container">
		<jyf-parser :html="detail.articleContent" ref="article"></jyf-parser>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: '',
				detail: {},
			}
		},
		methods: {
			// 获取文章详情
			async getArticleDetail () {
				let res = await this.$fetch(this.$api.get_article_by_id, { id: 1 }, 'POST')
				if (res.code) return uni.showToast({ title: res.msg, icon: 'none' })
				res.data.articleContent = res.data.articleContent.replace(/width:/ig, 'aaa')
				this.detail = res.data
				uni.setNavigationBarTitle({ title: this.detail.articleTitle })
			}
		},
		onLoad() {
			// this.getArticleDetail()
		},
		onShow() {
			this.getArticleDetail()
		}
		
	}
</script>

<style lang="less">
.container {
	padding: 30rpx;
	height: calc(100vh - 60rpx);
	background-color: #FFFFFF;
}
</style>
